package demo.demo05.test04;

//子类继承父类，就拥有了父类的全部方法
public class Student extends Person {
    public Student() {
        super();
        System.out.println("student无参构造");
    }

    protected String name = "zhiyihao";

    public void print() {
        System.out.println("student");
    }

    public void test(String name) {
        System.out.println(name);//朱衣灏
        System.out.println(this.name);//zhuyihao
        System.out.println(super.name);//父类的zyh
    }

    public void test1() {
        print();//student
        this.print();//本类的print-student
        super.print();//父类的print-person
    }
}
